﻿using Heng.Elements.Core.Model.Infrastructure.Entities;
using Heng.Elements.Core.Model.Infrastructure.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Heng.Elements.Core.Model.Infrastructure.Services
{
    /// <summary>
    /// Implemented by entity service.
    /// </summary>
    /// <typeparam name="TEntity"> Entity type. </typeparam>
    public interface IEntityService<TEntity> : IModelService
        where TEntity : class, IEntity
    {
        ServiceResponse<TEntity> GetById(long id);
        ServiceResponse<IEnumerable<TEntity>> GetAll();
        ServiceResponse Add(TEntity entity);
        ServiceResponse Save(TEntity entity);
        ServiceResponse Delete(TEntity entity);
        ServiceResponse Delete(long id);
    }
}
